#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

int n, m;
ll dp[15][1 << 9][85];
vector<int> cand;
void init() {
  int mx = (1 << n) - 1;
  rep(i, 0, mx) {
    int j = i >> 1;
    if (!(i & j)) cand.push_back(i);
  }
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  init();
  dp[0][0][0] = 1;
  rep(i, 1, n + 1) {
    for (int u : cand) {
      int mask = u | (u >> 1) | (u << 1);
      rep(j, 0, n * n) {
        if (!dp[i - 1][u][j]) continue;
        for (int v : cand) {
          if (v & mask) continue;
          int k = j + __builtin_popcount(v);
          dp[i][v][k] += dp[i - 1][u][j];
        }
      }
    }
  }
  cout << dp[n + 1][0][m];
  return 0;
}